<?php


namespace app\admin\controller;


use app\admin\service\RequestService;
use app\model\SetPay;

class SetPayController extends AController{

    public function index(RequestService $curdService){
        $list = $curdService->index(new SetPay(), [], [], false);
        return jsonSuccess([
            'items' => $list
        ]);
    }

    public function add(RequestService $curdService){
        return $curdService->add(new SetPay());
    }

    public function edit(RequestService $curdService){
        $id = request()->param('id');
        if (request()->isPost()){
            return $curdService->edit(new SetPay());
        }else{
            $info = SetPay::find($id);
            return jsonSuccess([
                'info' => $info
            ]);
        }

    }

    public function del(){

    }

}
